//
//  TestAlone_2_Controller.m
//  ProjectDemo
//
//  Created by IOS3 on 2019/1/4.
//  Copyright © 2019 IOS3. All rights reserved.
//

#import "TestAlone_2_Controller.h"
#import "TestEssayLineCell.h"
#import "TestEssayAnserView.h"

@interface TestAlone_2_Controller ()

@property (nonatomic, assign) NSInteger tableViewSelected;

@end

@implementation TestAlone_2_Controller

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = UIColor.whiteColor;
    self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
    [self.tableView registerClass:TestEssayLineCell.class forCellReuseIdentifier:NSStringFromClass(TestEssayLineCell.class)];
    self.tableView.rowHeight = UITableViewAutomaticDimension;
    self.tableView.estimatedRowHeight = 44;
    
    TestEssayAnserView *header = TestEssayAnserView.new;
    header.frame = CGRectMake(0, 0, SCREEN_WIDTH, 200);
    self.tableView.tableHeaderView = header;
    
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    TestEssayLineCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(TestEssayLineCell.class) forIndexPath:indexPath];
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSLog(@"选中: %ld", indexPath.row);
    self.tableViewSelected = indexPath.row;
}


@end
